package com.flycms.module.comment.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.flycms.module.comment.model.Comments;

@Repository
public interface AppCommentDao {

    int addComment(Comments comment);
    
    int editComment(Comments comment);
    
    int removeCommentById(@Param("id") Integer id);
    
    List<Comments> getCommentList(
            @Param("contentId") Long contentId,
            @Param("userId") Long userId,
            @Param("status") Integer status,
            @Param("orderby") String orderby,
            @Param("order") String order,
            @Param("pageIndex") Integer pageIndex,
            @Param("pageSize") Integer pageSize);
    
    int getCommentCount(
            @Param("contentId") Long contentId,
            @Param("userId") Long userId,
            @Param("status") Integer status);
    
    int editCommentVote(@Param("id") Integer id,
            @Param("upCount") Integer upCount,
            @Param("downCount") Integer downCount);
    
    int queryCommentCount(@Param("contentId") Long contentId);
    
    Comments queryCommentById(@Param("id") Integer id);

    Float sumStarByCommentId(@Param("id") Long id);
}
